<template>

    <el-table
            :data="tableData.filter(data => !search || data.name.toLowerCase().includes(search.toLowerCase()))"
            style="width: 100%">
        <el-table-column
                label="所属单位"
                prop="date">
        </el-table-column>
        <el-table-column
                label="用户姓名"
                prop="name">
        </el-table-column>
        <el-table-column
                label="手机号"
                prop="time">
        </el-table-column>
        <el-table-column
                label="部门"
                prop="bumen">
        </el-table-column>
        <el-table-column
                label="角色"
                prop="juese">
        </el-table-column>
        <el-table-column
                label="创建日期"
                prop="riqi">
        </el-table-column>
        <el-table-column
                label="状态"
                prop="zhuangtai">
        </el-table-column>
        <el-table-column
                align="right">
            <template slot="header" slot-scope="scope">
                <el-input
                        v-model="search"
                        size="mini"
                        placeholder="输入关键字搜索"/>
            </template>
            <template slot-scope="scope">
                <el-button
                        size="mini"
                        @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
                <el-button
                        size="mini"
                        type="danger"
                        @click="handleDelete(scope.$index, scope.row)">删除</el-button>
            </template>
        </el-table-column>
    </el-table>


</template>

<script>
    export default {
        data() {
            return {
                tableData: [{
                    date: '朔州经济开发区',
                    name: '5678900',
                    address: '上海市普陀区金沙江路 1518 弄',
                    time:'1937238472',
                    bumen:'',
                    juese:'渠道公司',
                    riqi:'2023年10月11日',
                    zhuangtai:'有效'
                }, {
                    date: '振华支行',
                    name: '7654322',
                    address: '上海市普陀区金沙江路 1517 弄',
                    time:'9865321836',
                    bumen:'',
                    juese:'渠道公司',
                    riqi:'2023年1月10日',
                    zhuangtai:'有效'
                }, {
                    date: '怀仁市支行',
                    name: '0987654',
                    address: '上海市普陀区金沙江路 1519 弄',
                    time:'17234532879',
                    bumen:'',
                    juese:'渠道公司',
                    riqi:'2023年12月19日',
                    zhuangtai:'有效'
                }],
                search: ''
            }
        },
        methods: {
            handleEdit(index, row) {
                console.log(index, row);
            },
            handleDelete(index, row) {
                console.log(index, row);
            }
        },
    }
</script>

<style scoped>

</style>


